package com.yitiao.data_algorithms.leetcode.editor.cn;

class PowerOfThree {
    // 2023-05-14 22:27:54
    public static void main(String[] args) {
        Solution solution = new PowerOfThree().new Solution();
    }

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public boolean isPowerOfThree(int n) {
            while (n != 0 && n % 3 == 0) {
                n /= 3;
            }
            return n == 1;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}